package com.maimao.kill.controller;

import com.maimao.core.model.resp.Result;
import com.maimao.kill.entity.vo.KillGoodsShowVo;
import com.maimao.kill.service.KillCacheService;
import com.maimao.model.kill.KillGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author MaoLin Wang
 * @date 2021/4/22 下午10:08
 */
@RestController
@RequestMapping("/kill/goods")
public class KillGoodsController {

    @Autowired
    private KillCacheService killCacheService;

    /**
     * 查询当前正在秒杀的排期和商品以及后期4个未开始的排期的商品
     *
     * @return KillGoodsShowVo
     */
    @GetMapping("/killData")
    public Result<?> currentShowKillGoodsData() {
        KillGoodsShowVo vo = killCacheService.currentShowKillGoodsData();
        return Result.okData(vo);
    }
}
